Optimal. Leaf size=144 \[ \frac{\sqrt [4]{-1} \sqrt{\pi } e^{\frac{i (b+i)^2}{4 c}-i a} \text{Erfi}\left (\frac{\sqrt [4]{-1} (-i b-2 i c x+1)}{2 \sqrt{c}}\right )}{4 \sqrt{c}}-\frac{\sqrt [4]{-1} \sqrt{\pi } e^{\frac{1}{4} i \left (4 a+\frac{(1+i b)^2}{c}\right )} \text{Erf}\left (\frac{\sqrt [4]{-1} (i b+2 i c x+1)}{2 \sqrt{c}}\right )}{4 \sqrt{c}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.168718, antiderivative size = 144, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {4473, 2234, 2204, 2205} \[ \frac{\sqrt [4]{-1} \sqrt{\pi } e^{\frac{i (b+i)^2}{4 c}-i a} \text{Erfi}\left (\frac{\sqrt [4]{-1} (-i b-2 i c x+1)}{2 \sqrt{c}}\right )}{4 \sqrt{c}}-\frac{\sqrt [4]{-1} \sqrt{\pi } e^{\frac{1}{4} i \left (4 a+\frac{(1+i b)^2}{c}\right )} \text{Erf}\left (\frac{\sqrt [4]{-1} (i b+2 i c x+1)}{2 \sqrt{c}}\right )}{4 \sqrt{c}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4473
Rule 2234
Rule 2204
Rule 2205
Rubi steps
\begin{align*} \int e^x \cos \left (a+b x+c x^2\right ) \, dx &=\int \left (\frac{1}{2} e^{-i a+(1-i b) x-i c x^2}+\frac{1}{2} e^{i a+(1+i b) x+i c x^2}\right ) \, dx\\ &=\frac{1}{2} \int e^{-i a+(1-i b) x-i c x^2} \, dx+\frac{1}{2} \int e^{i a+(1+i b) x+i c x^2} \, dx\\ &=\frac{1}{2} e^{\frac{1}{4} i \left (4 a+\frac{(1+i b)^2}{c}\right )} \int e^{-\frac{i (1+i b+2 i c x)^2}{4 c}} \, dx+\frac{1}{2} e^{-\frac{i \left (1-2 i b-b^2+4 a c\right )}{4 c}} \int e^{\frac{i (1-i b-2 i c x)^2}{4 c}} \, dx\\ &=-\frac{\sqrt [4]{-1} e^{\frac{1}{4} i \left (4 a+\frac{(1+i b)^2}{c}\right )} \sqrt{\pi } \text{erf}\left (\frac{\sqrt [4]{-1} (1+i b+2 i c x)}{2 \sqrt{c}}\right )}{4 \sqrt{c}}+\frac{\sqrt [4]{-1} e^{-\frac{i \left (1-2 i b-b^2+4 a c\right )}{4 c}} \sqrt{\pi } \text{erfi}\left (\frac{\sqrt [4]{-1} (1-i b-2 i c x)}{2 \sqrt{c}}\right )}{4 \sqrt{c}}\\ \end{align*}
Mathematica [A] time = 0.254125, size = 135, normalized size = 0.94 \[ \frac{\sqrt [4]{-1} \sqrt{\pi } e^{-\frac{i \left (b^2-2 i b+1\right )}{4 c}} \left (e^{\left .\frac{i}{2}\right /c} (\sin (a)-i \cos (a)) \text{Erfi}\left (\frac{\sqrt [4]{-1} (b+2 c x-i)}{2 \sqrt{c}}\right )-e^{\frac{i b^2}{2 c}} (\cos (a)-i \sin (a)) \text{Erfi}\left (\frac{(-1)^{3/4} (b+2 c x+i)}{2 \sqrt{c}}\right )\right )}{4 \sqrt{c}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.05, size = 115, normalized size = 0.8 \begin{align*}{\frac{\sqrt{\pi }}{4}{{\rm e}^{{\frac{{\frac{i}{4}} \left ( 2\,ib-4\,ac+{b}^{2}-1 \right ) }{c}}}}{\it Erf} \left ( \sqrt{ic}x-{\frac{-ib+1}{2}{\frac{1}{\sqrt{ic}}}} \right ){\frac{1}{\sqrt{ic}}}}-{\frac{\sqrt{\pi }}{4}{{\rm e}^{{\frac{{\frac{i}{4}} \left ( -{b}^{2}+2\,ib+4\,ac+1 \right ) }{c}}}}{\it Erf} \left ( -\sqrt{-ic}x+{\frac{1+ib}{2}{\frac{1}{\sqrt{-ic}}}} \right ){\frac{1}{\sqrt{-ic}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 2.36101, size = 420, normalized size = 2.92 \begin{align*} -\frac{\sqrt{\pi }{\left ({\left ({\left (\cos \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + \cos \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) - i \, \sin \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + i \, \sin \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right )\right )} \cos \left (-\frac{b^{2} - 4 \, a c - 1}{4 \, c}\right ) -{\left (i \, \cos \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + i \, \cos \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + \sin \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) - \sin \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right )\right )} \sin \left (-\frac{b^{2} - 4 \, a c - 1}{4 \, c}\right )\right )} \operatorname{erf}\left (\frac{i \,{\left (2 i \, c x + i \, b - 1\right )} \sqrt{i \, c}}{2 \, c}\right ) +{\left ({\left (\cos \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + \cos \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + i \, \sin \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) - i \, \sin \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right )\right )} \cos \left (-\frac{b^{2} - 4 \, a c - 1}{4 \, c}\right ) -{\left (-i \, \cos \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) - i \, \cos \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) + \sin \left (\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right ) - \sin \left (-\frac{1}{4} \, \pi + \frac{1}{2} \, \arctan \left (0, c\right )\right )\right )} \sin \left (-\frac{b^{2} - 4 \, a c - 1}{4 \, c}\right )\right )} \operatorname{erf}\left (\frac{i \,{\left (2 i \, c x + i \, b + 1\right )} \sqrt{-i \, c}}{2 \, c}\right )\right )} e^{\left (-\frac{b}{2 \, c}\right )}}{8 \, \sqrt{{\left | c \right |}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.500248, size = 647, normalized size = 4.49 \begin{align*} \frac{\sqrt{2} \pi \sqrt{\frac{c}{\pi }} e^{\left (\frac{i \, b^{2} - 4 i \, a c - 2 \, b - i}{4 \, c}\right )} \operatorname{C}\left (\frac{\sqrt{2}{\left (2 \, c x + b + i\right )} \sqrt{\frac{c}{\pi }}}{2 \, c}\right ) - \sqrt{2} \pi \sqrt{\frac{c}{\pi }} e^{\left (\frac{-i \, b^{2} + 4 i \, a c - 2 \, b + i}{4 \, c}\right )} \operatorname{C}\left (-\frac{\sqrt{2}{\left (2 \, c x + b - i\right )} \sqrt{\frac{c}{\pi }}}{2 \, c}\right ) - i \, \sqrt{2} \pi \sqrt{\frac{c}{\pi }} e^{\left (\frac{i \, b^{2} - 4 i \, a c - 2 \, b - i}{4 \, c}\right )} \operatorname{S}\left (\frac{\sqrt{2}{\left (2 \, c x + b + i\right )} \sqrt{\frac{c}{\pi }}}{2 \, c}\right ) - i \, \sqrt{2} \pi \sqrt{\frac{c}{\pi }} e^{\left (\frac{-i \, b^{2} + 4 i \, a c - 2 \, b + i}{4 \, c}\right )} \operatorname{S}\left (-\frac{\sqrt{2}{\left (2 \, c x + b - i\right )} \sqrt{\frac{c}{\pi }}}{2 \, c}\right )}{4 \, c} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{x} \cos{\left (a + b x + c x^{2} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15175, size = 198, normalized size = 1.38 \begin{align*} -\frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (-\frac{1}{4} \, \sqrt{2}{\left (2 \, x + \frac{b - i}{c}\right )}{\left (-\frac{i \, c}{{\left | c \right |}} + 1\right )} \sqrt{{\left | c \right |}}\right ) e^{\left (-\frac{i \, b^{2} - 4 i \, a c + 2 \, b - i}{4 \, c}\right )}}{4 \,{\left (-\frac{i \, c}{{\left | c \right |}} + 1\right )} \sqrt{{\left | c \right |}}} - \frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (-\frac{1}{4} \, \sqrt{2}{\left (2 \, x + \frac{b + i}{c}\right )}{\left (\frac{i \, c}{{\left | c \right |}} + 1\right )} \sqrt{{\left | c \right |}}\right ) e^{\left (-\frac{-i \, b^{2} + 4 i \, a c + 2 \, b + i}{4 \, c}\right )}}{4 \,{\left (\frac{i \, c}{{\left | c \right |}} + 1\right )} \sqrt{{\left | c \right |}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]